package com.vainycos.lotterysearch.exception;

import com.vainycos.lotterysearch.enums.ExceptionEnum;
import lombok.Data;

/**
 * @author: Vainycos
 * @description 业务异常
 * @date: 2022/11/10 9:46
 */
@Data
public class BusinessException extends RuntimeException{

    private final String code;

    private final String message;

    public BusinessException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BusinessException(ExceptionEnum exceptionEnum) {
        this(exceptionEnum.getCode(), exceptionEnum.getMessage());
    }
}
